"""
-------------------------------
- File_Name: logs.py
- Date: 2025/4/17
- Author: yangzhide
- Email: xxzjyzd@126.com
- Description: 系统管理日志模型
-------------------------------
"""

from pydantic import BaseModel, Field

from app.utils.common import to_camel_case


class SystemLog(BaseModel):
    """系统管理-日志管理列表"""

    id: int = Field(..., title="日志ID")
    user_name: str = Field(title="用户名称")
    user_code: str = Field(title="用户编码")
    method: str | None = Field(None, title="请求方法")
    summary: str | None = Field(None, title="摘要")
    ip_address: str = Field(title="IP地址")
    request_url: str = Field(title="请求路径")
    request_params: dict = Field(title="查询参数")
    request_data: dict = Field(title="请求体")
    response_data: dict = Field(title="响应数据")
    create_time: str = Field(title="请求时间")
    process_time: str = Field(title="处理时间")
    msg: str = Field(title = "响应信息")


    class Config:
        alias_generator = to_camel_case
        populate_by_name = True